<template>
<div class="home">
  <h2>
    当前计数：{{$store.state.counter}}
  </h2>
  <button @click="incrementAction">发起action修改counter</button>
  <h2>
    当前name:{{$store.state.name}}
  </h2>
  <button v-on:click="changeNameAction('ding--')">发起action修改name</button>
</div>
</template>

<script>
 import {mapActions} from 'vuex'

 export default{
   data(){
     return{

     }
   },
   methods:{
     ...mapActions(['incrementAction','changeNameAction'])
   }
 }
</script>



<style scoped>

</style>